package com.kunbo.cn.entity.system.user;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * 部门类，对应于数据库中部门的id和名称
 * @author    秦晓宇
 * @date      2017年2月28日 下午6:25:20 
 */
@Entity
@Table(name="db_system_user_department")
public class Department {

	public enum Status
	{
		ServiceStation,
		GuoNeng
	}
	
	
	@Id @Column(name="id")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	int id;	
	int parent_id;				/**父id*/
	String text;				/**组织名称*/
	Status type;					//类型
	
	@Transient
	List<Department> children;

	public Department(int parent_id, String text,Status type) {
		super();
		this.parent_id = parent_id;
		this.text = text;
		this.type = type;
	}
	
	
	public Department(int id, int parent_id, String text,Status type, List<Department> children) {
		super();
		this.id = id;
		this.parent_id = parent_id;
		this.text = text;
		this.children = children;
		this.type = type;
	}

	
	
	public Status getType() {
		return type;
	}


	public void setType(Status type) {
		this.type = type;
	}


	public Department() {
		super();
		// TODO Auto-generated constructor stub
	}

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getParent_id() {
		return parent_id;
	}

	public void setParent_id(int parent_id) {
		this.parent_id = parent_id;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public List<Department> getChildren() {
		return children;
	}

	public void setChildren(List<Department> children) {
		this.children = children;
	}
	
	
		
}
